package com.taiji.dianthus.dao.api;

import com.taiji.dianthus.domain.sms.api.SmsDomain;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @InterfaceName SmsInfoRepository
 * @Description
 * @Author H.M
 * @Date 2020/7/15
 */
@Repository
public interface SmsPublicUseRepository extends JpaRepository<SmsDomain, String>,
        JpaSpecificationExecutor<SmsDomain> {

    @Query("select domain from SmsDomain domain where domain.smsGroup like :msgGroup")
    SmsDomain getOneByGroup(@Param("msgGroup") String msgGroup);

    @Query("select t from SmsDomain  t where t.accountId=:id")
    SmsDomain getInfoByAccountId(@Param("id") String id);
}
